package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBUtil {
    private static final String URL = "jdbc:sqlite:identifier.sqlite";
    public static Connection conn;
    // 获取数据库连接
    public static void init() throws SQLException {
        conn = DriverManager.getConnection("jdbc:sqlite:identifier.sqlite");
    }
    // 安全关闭连接
    public static void closeQuietly(Connection conn) {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException e) {
                // 可记录日志
            }
        }
    }
}